home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / armedf.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  37KB  |  1,115 lines

  1. /**********************************************************************
  2.  
  3. Armed Formation
  4. (c)1988 Nichibutsu
  5.  
  6. Terra Force
  7. (c)1987 Nichibutsu
  8.  
  9. Kodure Ookami
  10. (c)1987 Nichibutsu
  11.  
  12. Crazy Climber 2
  13. (c)1988 Nichibutsu
  14.  
  15. 68000 + Z80
  16.  
  17. ***********************************************************************/
  18.  
  19. #include "driver.h"
  20. #include "vidhrdw/generic.h"
  21. #include "cpu/m68000/m68000.h"
  22. #include "cpu/z80/z80.h"
  23.  
  24. extern void armedf_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  25. extern void cclimbr2_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  26. extern int terraf_vh_start(void);
  27. extern int armedf_vh_start(void);
  28. extern int kodure_vh_start(void);
  29. extern void armedf_vh_stop(void);
  30.  
  31. WRITE_HANDLER( armedf_bg_videoram_w );
  32. READ_HANDLER( armedf_bg_videoram_r );
  33. WRITE_HANDLER( armedf_fg_videoram_w );
  34. READ_HANDLER( armedf_fg_videoram_r );
  35. READ_HANDLER( armedf_text_videoram_r );
  36. WRITE_HANDLER( armedf_text_videoram_w );
  37. READ_HANDLER( terraf_text_videoram_r );
  38. WRITE_HANDLER( terraf_text_videoram_w );
  39.  
  40. extern UINT16 armedf_vreg;
  41. extern UINT16 terraf_scroll_msb;
  42. extern UINT16 armedf_bg_scrollx,armedf_bg_scrolly;
  43. extern unsigned char *armedf_bg_videoram;
  44. extern UINT16 armedf_fg_scrollx,armedf_fg_scrolly;
  45. extern unsigned char *armedf_fg_videoram;
  46.  
  47. static WRITE_HANDLER( io_w ){
  48.     switch (offset/2){
  49.         case 0x0:
  50.         armedf_vreg = COMBINE_WORD(armedf_vreg,data);
  51.         /* bits 0 and 1 of armedf_vreg are coin counters */
  52.         break;
  53.  
  54.         case 0x1:
  55.         armedf_bg_scrollx = COMBINE_WORD(armedf_bg_scrollx, data);
  56.         break;
  57.  
  58.         case 0x2:
  59.         armedf_bg_scrolly = COMBINE_WORD(armedf_bg_scrolly, data);
  60.         break;
  61.  
  62.         case 0x3:
  63.         armedf_fg_scrollx = COMBINE_WORD(armedf_fg_scrollx, data);
  64.         break;
  65.  
  66.         case 0x4:
  67.         {
  68.             static int flipflop = 0; /* hack? - needed for Terra Force */
  69.             flipflop = 1-flipflop;
  70.             if( !flipflop ){
  71.                 armedf_fg_scrolly = COMBINE_WORD(armedf_fg_scrolly, data);
  72.             }
  73.             else {
  74.                 terraf_scroll_msb = COMBINE_WORD(terraf_scroll_msb, data);
  75.             }
  76.         }
  77.         break;
  78.  
  79.         case 0x5:
  80.         soundlatch_w(offset,((data & 0x7f) << 1) | 1);
  81.         break;
  82.  
  83.         default:
  84.         logerror("IO OUTPUT [%x] <- %08x\n", offset,data );
  85.         break;
  86.     }
  87. }
  88.  
  89. static WRITE_HANDLER( kodure_io_w ){
  90.     switch (offset/2){
  91.         case 0x0:
  92.         armedf_vreg = COMBINE_WORD(armedf_vreg,data);
  93.         /* bits 0 and 1 of armedf_vreg are coin counters */
  94.  
  95.         /* This is a temporary condition specification. */
  96.         if (!(armedf_vreg & 0x0080))
  97.         {
  98.             int i;
  99.             for (i = 0; i < 0x2000; i++)
  100.             {
  101.                 terraf_text_videoram_w(i, ' ');
  102.             }
  103.         }
  104.         break;
  105.  
  106.         case 0x1:
  107.         armedf_bg_scrollx = COMBINE_WORD(armedf_bg_scrollx, data);
  108.         break;
  109.  
  110.         case 0x2:
  111.         armedf_bg_scrolly = COMBINE_WORD(armedf_bg_scrolly, data);
  112.         break;
  113.  
  114.         case 0x5:
  115.         soundlatch_w(offset,((data & 0x7f) << 1) | 1);
  116.         break;
  117.  
  118.         default:
  119.         logerror("IO OUTPUT [%x] <- %08x\n", offset,data );
  120.         break;
  121.     }
  122. }
  123.  
  124. static READ_HANDLER( io_r ){
  125.     switch (offset) {
  126.         case 0: /* Input */
  127.         return input_port_0_r(offset) + 256*input_port_2_r(offset);
  128.  
  129.         case 2: /* Input */
  130.         return input_port_1_r(offset) + 256*input_port_3_r(offset);
  131.  
  132.         case 4: /* DIPSWITCH */
  133.         return input_port_4_r(offset);
  134.  
  135.         case 6: /* DIPSWITCH */
  136.         return input_port_5_r(offset);
  137.  
  138.         default: return (0xffff);
  139.     }
  140. }
  141.  
  142. /* the scroll registers are memory mapped in kodure, I/O ports in the others */
  143. static WRITE_HANDLER( kodure_videoreg_w )
  144. {
  145.     switch (offset)
  146.     {
  147.         case    0x16:
  148.             armedf_fg_scrolly = (data & 0x00ff);
  149.             break;
  150.         case    0x18:
  151.             armedf_fg_scrolly |= ((data & 0x00ff) << 8);
  152.             break;
  153.         case    0x1a:
  154.             armedf_fg_scrollx = (data & 0x00ff);
  155.             break;
  156.         case    0x1c:
  157.             armedf_fg_scrollx |= ((data & 0x00ff) << 8);
  158.             break;
  159.         default:
  160.             break;
  161.     }
  162. }
  163.  
  164. static struct MemoryReadAddress terraf_readmem[] = {
  165.     { 0x000000, 0x04ffff, MRA_ROM },
  166.     { 0x060000, 0x063fff, MRA_BANK1 }, /* sprites */
  167.     { 0x064000, 0x064fff, paletteram_word_r },
  168.  
  169.     { 0x068000, 0x069fff, terraf_text_videoram_r },
  170.     { 0x06a000, 0x06a9ff, MRA_BANK2 },
  171.  
  172.     { 0x06C000, 0x06C9ff, MRA_BANK3 },
  173.     { 0x070000, 0x070fff, armedf_fg_videoram_r },
  174.     { 0x074000, 0x074fff, armedf_bg_videoram_r },
  175.     { 0x078000, 0x07800f, io_r },
  176.     { -1 }
  177. };
  178.  
  179. static struct MemoryWriteAddress terraf_writemem[] = {
  180.     { 0x000000, 0x04ffff, MWA_ROM },
  181.     { 0x060000, 0x063fff, MWA_BANK1, &spriteram },
  182.     { 0x064000, 0x064fff, paletteram_xxxxRRRRGGGGBBBB_word_w, &paletteram },
  183.  
  184.     { 0x068000, 0x069fff, terraf_text_videoram_w, &videoram },
  185.     { 0x06a000, 0x06a9ff, MWA_BANK2 },
  186.  
  187.     { 0x06C000, 0x06C9ff, MWA_BANK3 },
  188.     { 0x070000, 0x070fff, armedf_fg_videoram_w, &armedf_bg_videoram },
  189.     { 0x074000, 0x074fff, armedf_bg_videoram_w, &armedf_fg_videoram },
  190.     { 0x07c000, 0x07c00f, io_w },
  191.     { 0x0c0000, 0x0c0001, MWA_NOP }, /* watchdog? */
  192.     { -1 }
  193. };
  194.  
  195. static struct MemoryReadAddress kodure_readmem[] = {
  196.     { 0x000000, 0x05ffff, MRA_ROM },
  197.     { 0x060000, 0x063fff, MRA_BANK1 }, /* sprites */
  198.     { 0x064000, 0x064fff, paletteram_word_r },
  199.  
  200.     { 0x068000, 0x069fff, terraf_text_videoram_r },
  201.     { 0x06a000, 0x06a9ff, MRA_BANK2 },
  202.  
  203.     { 0x06C000, 0x06C9ff, MRA_BANK3 },
  204.     { 0x070000, 0x070fff, armedf_fg_videoram_r },
  205.     { 0x074000, 0x074fff, armedf_bg_videoram_r },
  206.     { 0x078000, 0x07800f, io_r },
  207.     { -1 }
  208. };
  209.  
  210. static struct MemoryWriteAddress kodure_writemem[] = {
  211.     { 0x000000, 0x05ffff, MWA_ROM },
  212.     { 0x060000, 0x063fff, MWA_BANK1, &spriteram },
  213.     { 0x064000, 0x064fff, paletteram_xxxxRRRRGGGGBBBB_word_w, &paletteram },
  214.  
  215.     { 0x068000, 0x06803f, kodure_videoreg_w },
  216.     { 0x068000, 0x069fff, terraf_text_videoram_w, &videoram },
  217.     { 0x06a000, 0x06a9ff, MWA_BANK2 },
  218.  
  219.     { 0x06C000, 0x06C9ff, MWA_BANK3 },
  220.     { 0x070000, 0x070fff, armedf_fg_videoram_w, &armedf_bg_videoram },
  221.     { 0x074000, 0x074fff, armedf_bg_videoram_w, &armedf_fg_videoram },
  222.     { 0x07c000, 0x07c00f, kodure_io_w },
  223.     { 0x0c0000, 0x0c0001, MWA_NOP }, /* watchdog? */
  224.  
  225.     { 0xffd000, 0xffd001, MWA_NOP }, /* ? */
  226.     { -1 }
  227. };
  228.  
  229. static struct MemoryReadAddress armedf_readmem[] =
  230. {
  231.     { 0x000000, 0x05ffff, MRA_ROM },
  232.     { 0x060000, 0x060fff, MRA_RAM },
  233.     { 0x061000, 0x065fff, MRA_RAM },
  234.     { 0x066000, 0x066fff, armedf_bg_videoram_r },
  235.     { 0x067000, 0x067fff, armedf_fg_videoram_r },
  236.     { 0x068000, 0x0682ff, MRA_RAM },
  237.     { 0x068300, 0x069fff, armedf_text_videoram_r },
  238.     { 0x06a000, 0x06afff, MRA_RAM },
  239.     { 0x06b000, 0x06bfff, MRA_RAM },
  240.     { 0x06c000, 0x06c00f, io_r },
  241.     { 0x06c010, 0x06c7ff, MRA_RAM },
  242.     { -1 }    /* end of table */
  243. };
  244.  
  245. static struct MemoryWriteAddress armedf_writemem[] ={
  246.     { 0x000000, 0x05ffff, MWA_ROM },
  247.     { 0x060000, 0x060fff, MWA_RAM, &spriteram },
  248.     { 0x061000, 0x065fff, MWA_RAM },
  249.     { 0x066000, 0x066fff, armedf_bg_videoram_w, &armedf_bg_videoram },
  250.     { 0x067000, 0x067fff, armedf_fg_videoram_w, &armedf_fg_videoram },
  251.     { 0x068000, 0x0682ff, MWA_RAM },
  252.     { 0x068300, 0x069fff, armedf_text_videoram_w, &videoram },
  253.     { 0x068d00, 0x068fff, MWA_RAM },
  254.     { 0x06a000, 0x06afff, paletteram_xxxxRRRRGGGGBBBB_word_w, &paletteram },
  255.     { 0x06b000, 0x06bfff, MWA_RAM },
  256.     { 0x06c000, 0x06c7ff, MWA_RAM },
  257.     { 0x06d000, 0x06d00f, io_w }, /* Output */
  258.     { -1 }    /* end of table */
  259. };
  260.  
  261. static struct MemoryReadAddress cclimbr2_readmem[] =
  262. {
  263.     { 0x000000, 0x05ffff, MRA_ROM },
  264.     { 0x060000, 0x063fff, MRA_BANK1 }, /* sprites */
  265.     { 0x064000, 0x064fff, paletteram_word_r },
  266.  
  267.     { 0x068000, 0x069fff, terraf_text_videoram_r },
  268.     { 0x06a000, 0x06a9ff, MRA_BANK2 },
  269.  
  270.     { 0x06C000, 0x06C9ff, MRA_BANK3 },
  271.     { 0x070000, 0x070fff, armedf_fg_videoram_r },
  272.     { 0x074000, 0x074fff, armedf_bg_videoram_r },
  273.     { 0x078000, 0x07800f, io_r },
  274.     { -1 }
  275. };
  276.  
  277. static struct MemoryWriteAddress cclimbr2_writemem[] ={
  278.     { 0x000000, 0x05ffff, MWA_ROM },
  279.     { 0x060000, 0x063fff, MWA_BANK1, &spriteram },
  280.     { 0x064000, 0x064fff, paletteram_xxxxRRRRGGGGBBBB_word_w, &paletteram },
  281.  
  282.     { 0x068000, 0x069fff, terraf_text_videoram_w, &videoram },
  283.     { 0x06a000, 0x06a9ff, MWA_BANK2 },
  284.  
  285.     { 0x06C000, 0x06C9ff, MWA_BANK3 },
  286.     { 0x06ca00, 0x06cbff, MWA_RAM },
  287.     { 0x070000, 0x070fff, armedf_fg_videoram_w, &armedf_bg_videoram },
  288.     { 0x074000, 0x074fff, armedf_bg_videoram_w, &armedf_fg_videoram },
  289.     { 0x07c000, 0x07c00f, io_w },
  290.     { -1 }
  291. };
  292.  
  293. static struct MemoryReadAddress soundreadmem[] ={
  294.     { 0x0000, 0xf7ff, MRA_ROM },
  295.     { 0xf800, 0xffff, MRA_RAM },
  296.     { -1 }    /* end of table */
  297. };
  298.  
  299. static struct MemoryWriteAddress soundwritemem[] ={
  300.     { 0x0000, 0xf7ff, MWA_ROM },
  301.     { 0xf800, 0xffff, MWA_RAM },
  302.     { -1 }    /* end of table */
  303. };
  304.  
  305. static struct MemoryReadAddress cclimbr2_soundreadmem[] ={
  306.     { 0x0000, 0xbfff, MRA_ROM },
  307.     { 0xc000, 0xffff, MRA_RAM },
  308.     { -1 }    /* end of table */
  309. };
  310.  
  311. static struct MemoryWriteAddress cclimbr2_soundwritemem[] ={
  312.     { 0x0000, 0xbfff, MWA_ROM },
  313.     { 0xc000, 0xffff, MWA_RAM },
  314.     { -1 }    /* end of table */
  315. };
  316.  
  317. static READ_HANDLER( soundlatch_clear_r )
  318. {
  319.     soundlatch_clear_w(0,0);
  320.     return 0;
  321. }
  322.  
  323. static struct IOReadPort readport[] =
  324. {
  325.     { 0x4, 0x4, soundlatch_clear_r },
  326.     { 0x6, 0x6, soundlatch_r },
  327.     { -1 }    /* end of table */
  328. };
  329.  
  330. static struct IOWritePort writeport[] =
  331. {
  332.     { 0x0, 0x0, YM3812_control_port_0_w },
  333.     { 0x1, 0x1, YM3812_write_port_0_w },
  334.       { 0x2, 0x2, DAC_0_signed_data_w },
  335.       { 0x3, 0x3, DAC_1_signed_data_w },
  336.     { -1 }    /* end of table */
  337. };
  338.  
  339. INPUT_PORTS_START( armedf )
  340.     PORT_START    /* IN0 */
  341.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY)
  342.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY)
  343.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY)
  344.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY)
  345.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  346.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  347.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  348.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  349.  
  350.     PORT_START    /* IN1 */
  351.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2)
  352.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  353.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2)
  354.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2)
  355.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2)
  356.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2)
  357.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2)
  358.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  359.  
  360.     PORT_START    /* Coin, Start */
  361.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  362.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  363.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
  364.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
  365.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
  366.  
  367.     PORT_START    /* Test Mode */
  368.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
  369.     PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
  370.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )     /* Tilt */
  371.     PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
  372.  
  373.     PORT_START    /* DSW0 */
  374.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  375.     PORT_DIPSETTING(    0x03, "3")
  376.     PORT_DIPSETTING(    0x02, "4")
  377.     PORT_DIPSETTING(    0x01, "5")
  378.     PORT_DIPSETTING(    0x00, "6")
  379.     PORT_DIPNAME( 0x04, 0x04, "First Bonus" )
  380.     PORT_DIPSETTING(    0x04, "20k")
  381.     PORT_DIPSETTING(    0x00, "40k")
  382.     PORT_DIPNAME( 0x08, 0x08, "Second Bonus" )
  383.     PORT_DIPSETTING(    0x08, "60k")
  384.     PORT_DIPSETTING(    0x00, "80k")
  385.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
  386.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  387.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  388.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  389.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  390.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  391.     PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
  392.     PORT_DIPSETTING(    0xc0, "Easy")
  393.     PORT_DIPSETTING(    0x80, "Normal")
  394.     PORT_DIPSETTING(    0x40, "Hard")
  395.     PORT_DIPSETTING(    0x00, "Very Hard")
  396.  
  397.     PORT_START    /* DSW1 */
  398.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  399.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  400.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  401.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  402.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  403.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  404.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  405.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  406.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
  407.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  408.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  409.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  410.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  411.     PORT_DIPNAME( 0x20, 0x20, "Allow Continue" )
  412.     PORT_DIPSETTING(    0x20, DEF_STR( No ) )
  413.     PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
  414.     PORT_DIPNAME( 0x40, 0x40, "Flip Screen ?" )
  415.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  416.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  417.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  418.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  419.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  420. INPUT_PORTS_END
  421.  
  422. INPUT_PORTS_START( terraf )
  423.     PORT_START    /* IN0 */
  424.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY)
  425.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY)
  426.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY)
  427.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY)
  428.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  429.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  430.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  431.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  432.  
  433.     PORT_START    /* IN1 */
  434.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2)
  435.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  436.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2)
  437.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2)
  438.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2)
  439.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2)
  440.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2)
  441.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  442.  
  443.     PORT_START    /* Coin, Start */
  444.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  445.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  446.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
  447.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
  448.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
  449.  
  450.     PORT_START    /* Test Mode */
  451.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
  452.     PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
  453.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )     /* Tilt */
  454.     PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
  455.  
  456.     PORT_START    /* DSW0 */
  457.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  458.     PORT_DIPSETTING(    0x03, "3")
  459.     PORT_DIPSETTING(    0x02, "4")
  460.     PORT_DIPSETTING(    0x01, "5")
  461.     PORT_DIPSETTING(    0x00, "6")
  462.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
  463.     PORT_DIPSETTING(    0x0c, "20k")
  464.     PORT_DIPSETTING(    0x08, "50k")
  465.     PORT_DIPSETTING(    0x04, "60k")
  466.     PORT_DIPSETTING(    0x00, "90k")
  467.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
  468.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  469.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  470.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) )
  471.     PORT_DIPSETTING(    0x20, DEF_STR( Upright ) )
  472.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  473.     PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
  474.     PORT_DIPSETTING(    0xc0, "Easy")
  475.     PORT_DIPSETTING(    0x80, "Normal")
  476.     PORT_DIPSETTING(    0x40, "Hard")
  477.     PORT_DIPSETTING(    0x00, "Very Hard")
  478.  
  479.     PORT_START    /* DSW1 */
  480.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  481.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  482.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  483.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  484.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  485.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  486.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  487.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  488.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
  489.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  490.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  491.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  492.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  493.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
  494.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  495.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  496.     PORT_DIPNAME( 0xc0, 0xc0, "Allow Continue" )
  497.     PORT_DIPSETTING(    0xc0, "0" )
  498.     PORT_DIPSETTING(    0x80, "3" )
  499.     PORT_DIPSETTING(    0x40, "5" )
  500.     PORT_DIPSETTING(    0x00, "Unlimited" )
  501. INPUT_PORTS_END
  502.  
  503. INPUT_PORTS_START( kodure )
  504.     PORT_START    /* IN0 */
  505.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY)
  506.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY)
  507.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY)
  508.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY)
  509.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  510.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  511.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  512.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  513.  
  514.     PORT_START    /* IN1 */
  515.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2)
  516.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  517.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2)
  518.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2)
  519.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2)
  520.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2)
  521.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2)
  522.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  523.  
  524.     PORT_START    /* Coin, Start */
  525.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  526.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  527.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
  528.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
  529.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
  530.  
  531.     PORT_START    /* Test Mode */
  532.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
  533.     PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
  534.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )     /* Tilt */
  535.     PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
  536.  
  537.     PORT_START    /* DSW0 */
  538.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  539.     PORT_DIPSETTING(    0x03, "3")
  540.     PORT_DIPSETTING(    0x02, "4")
  541.     PORT_DIPSETTING(    0x01, "5")
  542.     PORT_DIPSETTING(    0x00, "6")
  543.     PORT_DIPNAME( 0x04, 0x04, "1st Bonus Life" )
  544.     PORT_DIPSETTING(    0x04, "None")
  545.     PORT_DIPSETTING(    0x00, "50k")
  546.     PORT_DIPNAME( 0x08, 0x08, "2nd Bonus Life" )
  547.     PORT_DIPSETTING(    0x08, "60k")
  548.     PORT_DIPSETTING(    0x00, "90k")
  549.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )
  550.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  551.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  552.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  553.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  554.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  555.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
  556.     PORT_DIPSETTING(    0x40, "Easy")
  557.     PORT_DIPSETTING(    0x00, "Hard")
  558.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  559.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  560.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  561.  
  562.     PORT_START    /* DSW1 */
  563.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  564.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  565.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  566.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  567.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  568.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  569.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  570.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_3C ) )
  571.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_3C ) )
  572.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_6C ) )
  573.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  574.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  575.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  576.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
  577.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  578.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  579.     PORT_DIPNAME( 0x40, 0x40, "Allow Continue" )
  580.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  581.     PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
  582.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  583.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  584.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  585. INPUT_PORTS_END
  586.  
  587. INPUT_PORTS_START( cclimbr2 )
  588.     PORT_START    /* IN0 */
  589.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP     | IPF_8WAY | IPF_PLAYER1 )
  590.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN   | IPF_8WAY | IPF_PLAYER1 )
  591.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT   | IPF_8WAY | IPF_PLAYER1 )
  592.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT  | IPF_8WAY | IPF_PLAYER1 )
  593.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_8WAY | IPF_PLAYER1 )
  594.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  595.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  596.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  597.  
  598.     PORT_START    /* IN1 */
  599.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP     | IPF_8WAY | IPF_PLAYER2 )
  600.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN   | IPF_8WAY | IPF_PLAYER2 )
  601.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT   | IPF_8WAY | IPF_PLAYER2 )
  602.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT  | IPF_8WAY | IPF_PLAYER2 )
  603.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_8WAY | IPF_PLAYER2 )
  604.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  605.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  606.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  607.  
  608.     PORT_START    /* Coin, Start */
  609.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  610.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  611.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
  612.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
  613.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
  614.  
  615.     PORT_START    /* Test Mode */
  616.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
  617.     PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
  618.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )     /* Tilt */
  619.     PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
  620.  
  621.     PORT_START    /* DSW0 */
  622.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  623.     PORT_DIPSETTING(    0x03, "3")
  624.     PORT_DIPSETTING(    0x02, "4")
  625.     PORT_DIPSETTING(    0x01, "5")
  626.     PORT_DIPSETTING(    0x00, "6")
  627.     PORT_DIPNAME( 0x04, 0x04, "First Bonus" )
  628.     PORT_DIPSETTING(    0x04, "30k")
  629.     PORT_DIPSETTING(    0x00, "60k")
  630.     PORT_DIPNAME( 0x08, 0x08, "Second Bonus" )
  631.     PORT_DIPSETTING(    0x08, "70k Only")
  632.     PORT_DIPSETTING(    0x00, "Nothing")
  633.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
  634.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  635.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  636.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  637.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  638.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  639.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
  640.     PORT_DIPSETTING(    0x40, "Easy")
  641.     PORT_DIPSETTING(    0x00, "Hard")
  642. #if 0
  643.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  644.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  645.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  646. #endif
  647.  
  648.     PORT_START    /* DSW1 */
  649.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  650.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  651.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  652.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  653.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  654.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  655.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  656.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  657.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
  658.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  659.     PORT_DIPNAME( 0x10, 0x10, "Continue Play" )
  660.     PORT_DIPSETTING(    0x10, "3")
  661.     PORT_DIPSETTING(    0x00, "0")
  662. #if 0
  663.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
  664.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  665.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  666. #endif
  667.     PORT_BITX(    0x40, 0x40, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  668.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  669.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  670. #if 0
  671.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  672.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  673.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  674. #endif
  675. INPUT_PORTS_END
  676.  
  677. static struct GfxLayout char_layout = {
  678.     8,8,    /* 8*8 characters */
  679.     1024,    /* 1024 characters */
  680.     4,    /* 4 bits per pixel */
  681.     { 0, 1, 2, 3 },
  682.     { 4, 0, 12, 8, 20, 16, 28, 24},
  683.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  684.     32*8    /* every char takes 32 consecutive bytes */
  685. };
  686.  
  687. static struct GfxLayout tile_layout = {
  688.     16,16,    /* 16*16 chars */
  689.     2048,
  690.     4,        /* 4 bits per pixel */
  691.     { 0, 1, 2, 3 }, /* plane offset */
  692.     { 4, 0, 12, 8, 20, 16, 28, 24,
  693.         32+4, 32+0, 32+12, 32+8, 32+20, 32+16, 32+28, 32+24, },
  694.     { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
  695.         8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
  696.     128*8
  697. };
  698.  
  699. static struct GfxLayout tile_layout2 = {
  700.     16,16,    /* 16*16 chars */
  701.     1024,
  702.     4,        /* 4 bits per pixel */
  703.     { 0, 1, 2, 3 }, /* plane offset */
  704.     { 4, 0, 12, 8, 20, 16, 28, 24,
  705.         32+4, 32+0, 32+12, 32+8, 32+20, 32+16, 32+28, 32+24, },
  706.     { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
  707.         8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
  708.     128*8
  709. };
  710.  
  711. static struct GfxLayout sprite_layout = {
  712.     16,16,    /* 16*16 chars */
  713.     2048,
  714.     4,        /* 4 bits per pixel */
  715.     { 0, 1, 2, 3 }, /* plane offset */
  716.     { 4, 0, 4+0x20000*8, 0+0x20000*8, 12, 8, 12+0x20000*8, 8+0x20000*8,
  717.         20, 16, 20+0x20000*8, 16+0x20000*8, 28, 24, 28+0x20000*8, 24+0x20000*8 },
  718.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
  719.         8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
  720.     64*8
  721. };
  722.  
  723. static struct GfxDecodeInfo gfxdecodeinfo[] =
  724. {
  725.     { REGION_GFX1, 0, &char_layout,         0*16,    32 },
  726.     { REGION_GFX2, 0, &tile_layout,        64*16,    32 },
  727.     { REGION_GFX3, 0, &tile_layout2,    96*16,    32 },
  728.     { REGION_GFX4, 0, &sprite_layout,    32*16,    32 },
  729.     { -1 } /* end of array */
  730. };
  731.  
  732. static struct YM3812interface ym3812_interface =
  733. {
  734.     1,                /* 1 chip (no more supported) */
  735.     4000000,        /* 4 MHz */
  736.     { 255 }         /* (not supported) */
  737. };
  738.  
  739. int armedf_interrupt(void){
  740.     return (1);
  741. }
  742.  
  743. int cclimbr2_interrupt(void){
  744.     return (2);
  745. }
  746.  
  747. static struct DACinterface dac_interface =
  748. {
  749.     2,    /* 2 channels */
  750.     { 100,100 },
  751. };
  752.  
  753. static struct DACinterface cclimbr2_dac_interface =
  754. {
  755.     2,    /* 2 channels */
  756.     { 40, 40 },
  757. };
  758.  
  759. static struct MachineDriver machine_driver_terraf =
  760. {
  761.     {
  762.         {
  763.             CPU_M68000,
  764.             8000000, /* 8 Mhz?? */
  765.             terraf_readmem,terraf_writemem,0,0,
  766.             armedf_interrupt,1
  767.         },
  768.         {
  769.             CPU_Z80 | CPU_AUDIO_CPU,
  770.             3072000,    /* 3.072 Mhz???? */
  771.             soundreadmem,soundwritemem,readport,writeport,
  772.             interrupt,128
  773.         },
  774.     },
  775.     57, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  776.     10,
  777.     0,
  778.  
  779.     /* video hardware */
  780.     38*8, 32*8, { 0*8, 38*8-1, 1*8, 31*8-1 },
  781.     gfxdecodeinfo,
  782.     2048,2048,
  783.     0,
  784.  
  785.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  786.     0,
  787.     terraf_vh_start,
  788.     armedf_vh_stop,
  789.     armedf_vh_screenrefresh,
  790.  
  791.     /* sound hardware */
  792.     0,0,0,0,
  793.     {
  794.         {
  795.            SOUND_YM3812,
  796.            &ym3812_interface
  797.         },
  798.         {
  799.             SOUND_DAC,
  800.             &dac_interface
  801.         }
  802.     }
  803. };
  804.  
  805. static struct MachineDriver machine_driver_kodure =
  806. {
  807.     {
  808.         {
  809.             CPU_M68000,
  810.             8000000, /* 8 Mhz?? */
  811.             kodure_readmem, kodure_writemem, 0, 0,
  812.             armedf_interrupt, 1
  813.         },
  814.         {
  815.             CPU_Z80 | CPU_AUDIO_CPU,
  816.             3072000,    /* 3.072 Mhz???? */
  817.             soundreadmem, soundwritemem, readport, writeport,
  818.             interrupt, 128
  819.         },
  820.     },
  821.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  822.     1,
  823.     0,
  824.  
  825.     /* video hardware */
  826.     38*8, 32*8, { 0*8, 38*8-1, 1*8, 31*8-1 },
  827.     gfxdecodeinfo,
  828.     2048,2048,
  829.     0,
  830.  
  831.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  832.     0,
  833.     kodure_vh_start,
  834.     armedf_vh_stop,
  835.     armedf_vh_screenrefresh,
  836.  
  837.     /* sound hardware */
  838.     0,0,0,0,
  839.     {
  840.         {
  841.             SOUND_YM3812,
  842.             &ym3812_interface
  843.         },
  844.         {
  845.             SOUND_DAC,
  846.             &dac_interface
  847.         }
  848.     }
  849. };
  850.  
  851. static struct MachineDriver machine_driver_armedf =
  852. {
  853.     {
  854.         {
  855.             CPU_M68000,
  856.             8000000, /* 8 Mhz?? */
  857.             armedf_readmem,armedf_writemem,0,0,
  858.             armedf_interrupt,1
  859.         },
  860.         {
  861.             CPU_Z80 | CPU_AUDIO_CPU,
  862.             3072000,    /* 3.072 Mhz???? */
  863.             soundreadmem,soundwritemem,readport,writeport,
  864.             interrupt,128
  865.         },
  866.     },
  867.     57, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  868.     10,
  869.     0,
  870.  
  871.     /* video hardware */
  872.     38*8, 32*8, { 0*8, 38*8-1, 1*8, 31*8-1 },
  873.     gfxdecodeinfo,
  874.     2048,2048,
  875.     0,
  876.  
  877.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  878.     0,
  879.     armedf_vh_start,
  880.     armedf_vh_stop,
  881.     armedf_vh_screenrefresh,
  882.  
  883.     /* sound hardware */
  884.     0,0,0,0,
  885.     {
  886.         {
  887.            SOUND_YM3812,
  888.            &ym3812_interface
  889.         },
  890.         {
  891.             SOUND_DAC,
  892.             &dac_interface
  893.         }
  894.     }
  895. };
  896.  
  897. static struct MachineDriver machine_driver_cclimbr2 =
  898. {
  899.     {
  900.         {
  901.             CPU_M68000,
  902.             8000000, /* 8 Mhz?? */
  903.             cclimbr2_readmem,cclimbr2_writemem,0,0,
  904.             cclimbr2_interrupt,1
  905.         },
  906.         {
  907.             CPU_Z80 | CPU_AUDIO_CPU,
  908.             3072000,    /* 3.072 Mhz???? */
  909.             cclimbr2_soundreadmem,cclimbr2_soundwritemem,readport,writeport,
  910.             interrupt,128
  911.         },
  912.     },
  913.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  914.     1,                        // nogi
  915.     0,
  916.  
  917.     /* video hardware */
  918.     38*8, 32*8, { 1*8, 37*8-1, 2*8, 30*8-1 },
  919.     gfxdecodeinfo,
  920.     2048,2048,
  921.     0,
  922.  
  923.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  924.     0,
  925.     terraf_vh_start,
  926.     armedf_vh_stop,
  927.     cclimbr2_vh_screenrefresh,
  928.  
  929.     /* sound hardware */
  930.     0,0,0,0,
  931.     {
  932.         {
  933.            SOUND_YM3812,
  934.            &ym3812_interface
  935.         },
  936.         {
  937.             SOUND_DAC,
  938.             &cclimbr2_dac_interface
  939.         }
  940.     }
  941. };
  942.  
  943.  
  944.  
  945. ROM_START( terraf )
  946.     ROM_REGION( 0x80000, REGION_CPU1 )    /* 64K*8 for 68000 code */
  947.     ROM_LOAD_EVEN( "terrafor.014", 0x00000, 0x10000, 0x8e5f557f )
  948.     ROM_LOAD_ODD(  "terrafor.011", 0x00000, 0x10000, 0x5320162a )
  949.     ROM_LOAD_EVEN( "terrafor.013", 0x20000, 0x10000, 0xa86951e0 )
  950.     ROM_LOAD_ODD(  "terrafor.010", 0x20000, 0x10000, 0x58b5f43b )
  951.     ROM_LOAD_EVEN( "terrafor.012", 0x40000, 0x08000, 0x4f0e1d76 )
  952.     ROM_LOAD_ODD(  "terrafor.009", 0x40000, 0x08000, 0xd1014280 )
  953.  
  954.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Z80 code (sound) */
  955.     ROM_LOAD( "terrafor.001", 0x00000, 0x10000, 0xeb6b4138 )
  956.  
  957.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  958.     ROM_LOAD( "terrafor.008", 0x00000, 0x08000, 0xbc6f7cbc ) /* characters */
  959.  
  960.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  961.     ROM_LOAD( "terrafor.006", 0x00000, 0x10000, 0x25d23dfd ) /* foreground tiles */
  962.     ROM_LOAD( "terrafor.007", 0x10000, 0x10000, 0xb9b0fe27 )
  963.  
  964.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  965.     ROM_LOAD( "terrafor.004", 0x00000, 0x10000, 0x2144d8e0 ) /* background tiles */
  966.     ROM_LOAD( "terrafor.005", 0x10000, 0x10000, 0x744f5c9e )
  967.  
  968.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  969.     ROM_LOAD( "terrafor.003", 0x00000, 0x10000, 0xd74085a1 ) /* sprites */
  970.     ROM_LOAD( "terrafor.002", 0x20000, 0x10000, 0x148aa0c5 )
  971.  
  972.     ROM_REGION( 0x4000, REGION_GFX5 )    /* data for mcu/blitter? */
  973.     ROM_LOAD( "tf.10",        0x0000, 0x4000, 0xac705812 )    /* TEST DATA ? */
  974.  
  975.     ROM_REGION( 0x0100, REGION_PROMS )
  976.     ROM_LOAD( "tf.clr",       0x0000, 0x0100, 0x81244757 )    /* ??? */
  977. ROM_END
  978.  
  979. ROM_START( terrafu )
  980.     ROM_REGION( 0x80000, REGION_CPU1 )    /* 64K*8 for 68000 code */
  981.     ROM_LOAD_EVEN( "tf.8",         0x00000, 0x10000, 0xfea6dd64 )
  982.     ROM_LOAD_ODD(  "tf.3",         0x00000, 0x10000, 0x02f9d05a )
  983.     ROM_LOAD_EVEN( "tf.7",         0x20000, 0x10000, 0xfde8de7e )
  984.     ROM_LOAD_ODD(  "tf.2",         0x20000, 0x10000, 0xdb987414 )
  985.     ROM_LOAD_EVEN( "tf.6",         0x40000, 0x08000, 0xb91e9ba3 )
  986.     ROM_LOAD_ODD(  "tf.1",         0x40000, 0x08000, 0xd6e22375 )
  987.  
  988.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Z80 code (sound) */
  989.     ROM_LOAD( "terrafor.001", 0x00000, 0x10000, 0xeb6b4138 )
  990.  
  991.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  992.     ROM_LOAD( "terrafor.008", 0x00000, 0x08000, 0xbc6f7cbc ) /* characters */
  993.  
  994.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  995.     ROM_LOAD( "terrafor.006", 0x00000, 0x10000, 0x25d23dfd ) /* foreground tiles */
  996.     ROM_LOAD( "terrafor.007", 0x10000, 0x10000, 0xb9b0fe27 )
  997.  
  998.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  999.     ROM_LOAD( "terrafor.004", 0x00000, 0x10000, 0x2144d8e0 ) /* background tiles */
  1000.     ROM_LOAD( "terrafor.005", 0x10000, 0x10000, 0x744f5c9e )
  1001.  
  1002.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  1003.     ROM_LOAD( "terrafor.003", 0x00000, 0x10000, 0xd74085a1 ) /* sprites */
  1004.     ROM_LOAD( "terrafor.002", 0x20000, 0x10000, 0x148aa0c5 )
  1005.  
  1006.     ROM_REGION( 0x4000, REGION_GFX5 )    /* data for mcu/blitter? */
  1007.     ROM_LOAD( "tf.10",        0x0000, 0x4000, 0xac705812 )    /* TEST DATA ? */
  1008.  
  1009.     ROM_REGION( 0x0100, REGION_PROMS )
  1010.     ROM_LOAD( "tf.clr",       0x0000, 0x0100, 0x81244757 )    /* ??? */
  1011. ROM_END
  1012.  
  1013. ROM_START( kodure )
  1014.     ROM_REGION( 0x60000, REGION_CPU1 )    /* 64K*8 for 68000 code */
  1015.     ROM_LOAD_EVEN( "kodure8.6e", 0x00000, 0x10000, 0x6bbfb1e6 )
  1016.     ROM_LOAD_ODD(  "kodure3.6h", 0x00000, 0x10000, 0xf9178ec8 )
  1017.     ROM_LOAD_EVEN( "kodure7.5e", 0x20000, 0x10000, 0xa7ee09bb )
  1018.     ROM_LOAD_ODD(  "kodure2.5h", 0x20000, 0x10000, 0x236d820f )
  1019.     ROM_LOAD_EVEN( "kodure6.3e", 0x40000, 0x10000, 0x9120e728 )
  1020.     ROM_LOAD_ODD(  "kodure1.3h", 0x40000, 0x10000, 0x345fe7a5 )
  1021.  
  1022.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Z80 code (sound) */
  1023.     ROM_LOAD( "kodure11.17k", 0x00000, 0x10000, 0xdba51e2d )
  1024.  
  1025.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1026.     ROM_LOAD( "kodure9.11e", 0x00000, 0x08000, 0xe041356e )    /* characters */
  1027.  
  1028.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  1029.     ROM_LOAD( "kodure5.15h", 0x00000, 0x20000, 0x0b510258 )    /* foreground tiles */
  1030.     ROM_LOAD( "kodure4.14h", 0x20000, 0x10000, 0xfb8e13e6 )
  1031.  
  1032.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  1033.     ROM_LOAD( "kodure14.8a", 0x00000, 0x10000, 0x94a9c3d0 )    /* background tiles */
  1034.  
  1035.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  1036.     ROM_LOAD( "kodure12.8d", 0x00000, 0x20000, 0x15f4021d )    /* sprites */
  1037.     ROM_LOAD( "kodure13.9d", 0x20000, 0x20000, 0xb3b6c753 )
  1038.  
  1039.     ROM_REGION( 0x4000, REGION_GFX5 )    /* data for mcu/blitter? */
  1040.     ROM_LOAD( "kodure10.11c", 0x0000, 0x4000, 0xf48be21d )    /* TEST DATA ? */
  1041.  
  1042.     ROM_REGION( 0x0100, REGION_PROMS )
  1043.     ROM_LOAD( "tf.11j", 0x0000, 0x0100, 0x81244757 )    /* ??? */
  1044. ROM_END
  1045.  
  1046. ROM_START( armedf )
  1047.     ROM_REGION( 0x80000, REGION_CPU1 )    /* 68000 code */
  1048.     ROM_LOAD_EVEN( "af_06.rom", 0x00000, 0x10000, 0xc5326603 )
  1049.     ROM_LOAD_ODD(  "af_01.rom", 0x00000, 0x10000, 0x458e9542 )
  1050.     ROM_LOAD_EVEN( "af_07.rom", 0x20000, 0x10000, 0xcc8517f5 )
  1051.     ROM_LOAD_ODD(  "af_02.rom", 0x20000, 0x10000, 0x214ef220 )
  1052.     ROM_LOAD_EVEN( "af_08.rom", 0x40000, 0x10000, 0xd1d43600 )
  1053.     ROM_LOAD_ODD(  "af_03.rom", 0x40000, 0x10000, 0xbbe1fe2d )
  1054.  
  1055.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Z80 code (sound) */
  1056.     ROM_LOAD( "af_10.rom", 0x00000, 0x10000, 0xc5eacb87 )
  1057.  
  1058.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1059.     ROM_LOAD( "af_09.rom", 0x00000, 0x08000, 0x7025e92d ) /* characters */
  1060.  
  1061.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  1062.     ROM_LOAD( "af_04.rom", 0x00000, 0x10000, 0x44d3af4f ) /* foreground tiles */
  1063.     ROM_LOAD( "af_05.rom", 0x10000, 0x10000, 0x92076cab )
  1064.  
  1065.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  1066.     ROM_LOAD( "af_14.rom", 0x00000, 0x10000, 0x8c5dc5a7 ) /* background tiles */
  1067.     ROM_LOAD( "af_13.rom", 0x10000, 0x10000, 0x136a58a3 )
  1068.  
  1069.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  1070.     ROM_LOAD( "af_11.rom", 0x00000, 0x20000, 0xb46c473c ) /* sprites */
  1071.     ROM_LOAD( "af_12.rom", 0x20000, 0x20000, 0x23cb6bfe )
  1072. ROM_END
  1073.  
  1074. ROM_START( cclimbr2 )
  1075.     ROM_REGION( 0x80000, REGION_CPU1 )    /* 64K*8 for 68000 code */
  1076.     ROM_LOAD_EVEN( "4.bin", 0x00000, 0x10000, 0x7922ea14 )
  1077.     ROM_LOAD_ODD(  "1.bin", 0x00000, 0x10000, 0x2ac7ed67 )
  1078.     ROM_LOAD_EVEN( "6.bin", 0x20000, 0x10000, 0x7905c992 )
  1079.     ROM_LOAD_ODD(  "5.bin", 0x20000, 0x10000, 0x47be6c1e )
  1080.     ROM_LOAD_EVEN( "3.bin", 0x40000, 0x10000, 0x1fb110d6 )
  1081.     ROM_LOAD_ODD(  "2.bin", 0x40000, 0x10000, 0x0024c15b )
  1082.  
  1083.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Z80 code (sound) */
  1084.     ROM_LOAD( "11.bin", 0x00000, 0x04000, 0xfe0175be )
  1085.     ROM_LOAD( "12.bin", 0x04000, 0x08000, 0x5ddf18f2 )
  1086.  
  1087.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1088.     ROM_LOAD( "10.bin", 0x00000, 0x08000, 0x7f475266 ) /* characters */
  1089.  
  1090.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  1091.     ROM_LOAD( "7.bin",  0x00000, 0x10000, 0xcbdd3906 ) /* foreground tiles */
  1092.     ROM_LOAD( "8.bin",  0x10000, 0x10000, 0xb2a613c0 )
  1093.  
  1094.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  1095.     ROM_LOAD( "17.bin", 0x00000, 0x10000, 0xe24bb2d7 ) /* background tiles */
  1096.     ROM_LOAD( "18.bin", 0x10000, 0x10000, 0x56834554 )
  1097.  
  1098.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  1099.     ROM_LOAD( "15.bin", 0x00000, 0x10000, 0x4bf838be ) /* sprites */
  1100.     ROM_LOAD( "16.bin", 0x10000, 0x10000, 0x21a265c5 )
  1101.     ROM_LOAD( "13.bin", 0x20000, 0x10000, 0x6b6ec999 )
  1102.     ROM_LOAD( "14.bin", 0x30000, 0x10000, 0xf426a4ad )
  1103.  
  1104.     ROM_REGION( 0x4000, REGION_GFX5 )    /* data for mcu/blitter? */
  1105.     ROM_LOAD( "9.bin",  0x0000, 0x4000, 0x740d260f )    // DATA ?
  1106. ROM_END
  1107.  
  1108.  
  1109.  
  1110. GAMEX( 1987, terraf,   0,      terraf,   terraf,   0, ROT0,   "Nichibutsu", "Terra Force", GAME_NO_COCKTAIL )
  1111. GAMEX( 1987, terrafu,  terraf, terraf,   terraf,   0, ROT0,   "Nichibutsu USA", "Terra Force (US)", GAME_NO_COCKTAIL )
  1112. GAMEX( 1987, kodure,   0,      kodure,   kodure,   0, ROT0,   "Nichibutsu", "Kodure Ookami (Japan)", GAME_NO_COCKTAIL )
  1113. GAMEX( 1988, armedf,   0,      armedf,   armedf,   0, ROT270, "Nichibutsu", "Armed Formation", GAME_NO_COCKTAIL )
  1114. GAMEX( 1988, cclimbr2, 0,      cclimbr2, cclimbr2, 0, ROT0,   "Nichibutsu", "Crazy Climber 2 (Japan)", GAME_NO_COCKTAIL )
  1115.